import axios from './http';
import { stringify } from 'qs';

export default {
  inputList(params) {
    const url = '/input/list';
    return new Promise((resolve, reject) => {
      axios.get(`${url}?${stringify(params)}`).then(data => {
        resolve(data)
      })
    });
  },
  drugCompany (params) {
    const url = '/drug/company';
    return new Promise((resolve, reject) => {
      axios.get(`${url}?${stringify(params)}`).then(data => {
        resolve(data)
      })
    });
  },
  drugQuery(params) {
    const url = '/drug/query';
    return new Promise((resolve, reject) => {
      axios.get(`${url}?${stringify(params)}`).then(data => {
        resolve(data)
      })
    });
  },
  drugSelect(params) {
    const url = '/drug/select';
    return new Promise((resolve, reject) => {
      axios.get(`${url}?${stringify(params)}`).then(data => {
        resolve(data)
      })
    });
  },
  drugAdd(params) {
    const url = '/input/add';
    return new Promise((resolve, reject) => {
      axios.post(url, params).then(data => {
        resolve(data)
      })
    });
  },
  inputDetail(params) {
    const url = '/input/detail';
    return new Promise((resolve, reject) => {
      axios.get(`${url}?${stringify(params)}`).then(data => {
        resolve(data)
      })
    });
  },
  inputCheck(params) {
    const url = '/input/check';
    return new Promise((resolve, reject) => {
      axios.get(`${url}?${stringify(params)}`).then(data => {
        resolve(data)
      })
    });
  },
  inputDelete(params) {
    const url = '/input/delete';
    return new Promise((resolve, reject) => {
      axios.get(`${url}?${stringify(params)}`).then(data => {
        resolve(data)
      })
    });
  },

  outputList(params) {
    const url = '/output/list';
    return new Promise((resolve, reject) => {
      axios.get(`${url}?${stringify(params)}`).then(data => {
        resolve(data)
      })
    });
  },
  outputDetail(params) {
    const url = '/output/detail';
    return new Promise((resolve, reject) => {
      axios.get(`${url}?${stringify(params)}`).then(data => {
        resolve(data)
      })
    });
  },
  outputCheck(params) {
    const url = '/output/check';
    return new Promise((resolve, reject) => {
      axios.get(`${url}?${stringify(params)}`).then(data => {
        resolve(data)
      })
    });
  },
  outputDelete(params) {
    const url = '/output/delete';
    return new Promise((resolve, reject) => {
      axios.get(`${url}?${stringify(params)}`).then(data => {
        resolve(data)
      })
    });
  },
  //当前库存
  drugList(params) {
    const url = '/drug/list';
    return new Promise((resolve, reject) => {
      axios.get(`${url}?${stringify(params)}`).then(data => {
        resolve(data)
      })
    });
  },
};
